#ifndef __RAMFS_H_
#define __RAMFS_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdio.h>
#include <stdint.h>
#include <string.h>

#include "slist.h"
#include "mem_inner.h"
#include "mem_sal.h"


#define RAMFS_NAME_MAX  32
#define RAMFS_MAGIC     0x0A0A0A0A




typedef struct _ramfs_dirent_s
{
    
    _list_t list;
    struct _dfs_ramfs_s *fs; /* file system ref */

    char name[RAMFS_NAME_MAX]; /* dirent name */
    uint8_t *data;

    size_t size; /* file size */

} _ramfs_dirent_t;


typedef struct _dfs_ramfs_s
{
    uint32_t magic;

    void *mem_obj;
    _ramfs_dirent_t root;

} _dfs_ramfs_obj;

/* export func */


int ramfs_dfs_register(void);
_dfs_ramfs_obj *ramfs_dfs_create(uint8_t *pool, size_t size);

#ifdef __cplusplus
}
#endif

#endif // __RAMFS_H_
